package com.zy.framework.web.service;

import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Service;

/**
 * @program: zhengyang
 * @description: js调用 thymeeaf 实现按钮权限可见性
 * @author: Lx
 * @create: 2019-01-07 23:57
 **/
@Service("permission")
public class PermissionService {


    public String hasPermi(String permission)
    {
     return    isPermittedOperator(permission) ? "" : "hidden";
    }
    private boolean isPermittedOperator(String permission)
    {
        return SecurityUtils.getSubject().isPermitted(permission);
    }
}
